<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Практика: Исходный файл /home/student/alekseev_semen/project/src/DecodeGH/ghmodel.cpp</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Практика
   </div>
   <div id="projectbrief">Приложение - описание классов</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Создано системой Doxygen 1.8.20 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">ghmodel.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp.html">См. документацию.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;ghmodel.h&quot;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;vector&quot;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;QDebug&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160; </div>
<div class="line"><a name="l00005"></a><span class="lineno"><a class="line" href="class_g_h_model.html#a202dda5e22612fb141cbcd30c69417e7">    5</a></span>&#160;<a class="code" href="class_g_h_model.html#a202dda5e22612fb141cbcd30c69417e7">GHModel::GHModel</a>(<a class="code" href="class_boofer_g_h.html">BooferGH</a> *data, QObject *parent) : <a class="code" href="class_q_abstract_table_model.html">QAbstractTableModel</a>(parent)</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;{</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;    <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a> = <a class="code" href="class_g_h_model.html#a96738a4b13c7d732e82d61295c9b4fb3">data</a>;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;}</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="class_g_h_model.html#a80b7f89d0d7dd6bfe078c7aa13102757">   10</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="class_g_h_model.html#a80b7f89d0d7dd6bfe078c7aa13102757">GHModel::rowCount</a>(<span class="keyword">const</span> QModelIndex&amp; parent)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    <span class="keywordflow">if</span> ( parent.isValid() || (<a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.size() == 0) )</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.size();</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;}</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="class_g_h_model.html#a216164b6463b89b27a49a117aa626793">   17</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="class_g_h_model.html#a216164b6463b89b27a49a117aa626793">GHModel::columnCount</a>(<span class="keyword">const</span> QModelIndex&amp; parent )<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    Q_UNUSED(parent);</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_g_h_model.html#a9e47fdafa7fb4714f534b2a0b6291b01">m_header</a>.count();</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;}</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="class_g_h_model.html#acddb2860fa3803c142e4dd64499061cb">   23</a></span>&#160;QVariant <a class="code" href="class_g_h_model.html#acddb2860fa3803c142e4dd64499061cb">GHModel::headerData</a>( <span class="keywordtype">int</span> section,</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;                                 Qt::Orientation orientation,</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;                                 <span class="keywordtype">int</span> role)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.size())</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;        <span class="keywordflow">return</span> QVariant();</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="keywordflow">if</span> (orientation == Qt::Horizontal) {</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        <span class="keywordflow">if</span> (role == Qt::DisplayRole)</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;            <span class="keywordflow">return</span> QVariant(<a class="code" href="class_g_h_model.html#a9e47fdafa7fb4714f534b2a0b6291b01">m_header</a>[section]);   <span class="comment">//QList m_records-&gt;at(0).at(section)</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    }</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (orientation == Qt::Vertical) {</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <span class="keywordflow">if</span> (role == Qt::DisplayRole)</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;            <span class="keywordflow">return</span> section+1;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    }</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keywordflow">return</span> QAbstractTableModel::headerData(</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        section, orientation, role);</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;}</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="class_g_h_model.html#a4c7d107fd510dbbd8806e661a6d262a2">   42</a></span>&#160;Qt::ItemFlags <a class="code" href="class_g_h_model.html#a4c7d107fd510dbbd8806e661a6d262a2">GHModel::flags</a>(<span class="keyword">const</span> QModelIndex &amp;index)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keywordflow">if</span> (!index.isValid() || !<a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.size())</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="keywordflow">return</span> QAbstractTableModel::flags(index) | Qt::ItemIsEditable;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;}</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="class_g_h_model.html#a96738a4b13c7d732e82d61295c9b4fb3">   48</a></span>&#160;QVariant <a class="code" href="class_g_h_model.html#a96738a4b13c7d732e82d61295c9b4fb3">GHModel::data</a>( <span class="keyword">const</span> QModelIndex &amp;index, <span class="keywordtype">int</span> role)<span class="keyword"> const</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="keywordflow">if</span> (!index.isValid() || !<a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.size())</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            <span class="keywordflow">return</span> QVariant();</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keywordflow">if</span> (role == Qt::SizeHintRole)</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            <span class="keywordflow">return</span> QSize(30, 12);</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keywordflow">if</span> (role == Qt::DisplayRole || role == Qt::EditRole)</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    {</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        <span class="keywordflow">if</span>(index.column() == 0)</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>[index.row()];</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <span class="keywordflow">if</span>(index.column() == 1)</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#abfaa06f538faffae990172acd7c64b77">data_y</a>[index.row()];</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    }</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordflow">if</span> (role == Qt::ToolTipRole)</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    {</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    }</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordflow">return</span> QVariant();</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;}</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="class_g_h_model.html#a36171e3ffe91d34433a7ecf183ae9b6b">   71</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_g_h_model.html#a36171e3ffe91d34433a7ecf183ae9b6b">GHModel::setData</a>(<span class="keyword">const</span> QModelIndex &amp;index, <span class="keyword">const</span> QVariant &amp;value, <span class="keywordtype">int</span> role)</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;{</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160; </div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keywordflow">if</span> (index.isValid() &amp;&amp;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;       (role == Qt::EditRole || role == Qt::DisplayRole)) {</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordflow">if</span>(index.column() == 0)</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>[index.row()] = value.toDouble();</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <span class="keywordflow">if</span>(index.column() == 1)</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#abfaa06f538faffae990172acd7c64b77">data_y</a>[index.row()] = value.toDouble();</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        emit dataChanged(index, index);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    }</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;}</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_g_h_model.html#a77d68b247079423f2977d8c83be20c7b">   86</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_g_h_model.html#a77d68b247079423f2977d8c83be20c7b">GHModel::insertRows</a>( <span class="keywordtype">int</span> row, <span class="keywordtype">int</span> count, <span class="keyword">const</span> QModelIndex&amp; parent) {</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    Q_UNUSED(parent);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    beginInsertRows(QModelIndex(), row, row+count-1);</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    std::vector&lt;double&gt;::iterator xit = <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.begin();</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    std::vector&lt;double&gt;::iterator yit = <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#abfaa06f538faffae990172acd7c64b77">data_y</a>.begin();</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    xit += row;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    yit += row;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;count; i++)</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    {</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        xit = <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.insert(xit, 0);</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        yit = <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#abfaa06f538faffae990172acd7c64b77">data_y</a>.insert(yit, 0);</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    }</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        <span class="comment">//m_records-&gt;insert(row+1, emptyRecord);</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    endInsertRows();</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;}</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="class_g_h_model.html#a409b014c8e1eef5d2ff8eae8a716c7b5">  103</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_g_h_model.html#a409b014c8e1eef5d2ff8eae8a716c7b5">GHModel::push_back_pair</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <span class="keyword">const</span> QModelIndex &amp;parent)</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;{</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    Q_UNUSED(parent);</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordtype">int</span> row = this-&gt;<a class="code" href="class_g_h_model.html#a80b7f89d0d7dd6bfe078c7aa13102757">rowCount</a>();</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    beginInsertRows(QModelIndex(), row, row);</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.push_back(x);</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#abfaa06f538faffae990172acd7c64b77">data_y</a>.push_back(y);</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    endInsertRows();</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;}</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="class_g_h_model.html#aa605317e7690ef97f23c3a7b58d033d5">  114</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_g_h_model.html#aa605317e7690ef97f23c3a7b58d033d5">GHModel::removeRows</a>( <span class="keywordtype">int</span> row, <span class="keywordtype">int</span> count, <span class="keyword">const</span> QModelIndex&amp; parent) {</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    Q_UNUSED(parent);</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.size() || row + count &gt; <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.size())</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    beginRemoveRows(QModelIndex(), row, row+count-1);</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    std::vector&lt;double&gt;::iterator xit = <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.begin();</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    std::vector&lt;double&gt;::iterator yit = <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#abfaa06f538faffae990172acd7c64b77">data_y</a>.begin();</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    xit += row;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    yit += row;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;count; i++)</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    {</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        xit = <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">data_x</a>.erase(xit);</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        yit = <a class="code" href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">boofer</a>-&gt;<a class="code" href="class_boofer_g_h.html#abfaa06f538faffae990172acd7c64b77">data_y</a>.erase(yit);</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    }</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    endRemoveRows();</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;}</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="class_g_h_model.html#a08aaf3279e8dff50674a06548fb99dc9">  134</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_g_h_model.html#a08aaf3279e8dff50674a06548fb99dc9">GHModel::setHeader</a>(<span class="keyword">const</span> QStringList &amp;header)</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;{</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <a class="code" href="class_g_h_model.html#a9e47fdafa7fb4714f534b2a0b6291b01">m_header</a> = header;</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aclass_g_h_model_html_a08aaf3279e8dff50674a06548fb99dc9"><div class="ttname"><a href="class_g_h_model.html#a08aaf3279e8dff50674a06548fb99dc9">GHModel::setHeader</a></div><div class="ttdeci">void setHeader(const QStringList &amp;header)</div><div class="ttdoc">setHeader устанавливает заголовки для колонок таблицы</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00134">ghmodel.cpp:134</a></div></div>
<div class="ttc" id="aclass_boofer_g_h_html"><div class="ttname"><a href="class_boofer_g_h.html">BooferGH</a></div><div class="ttdoc">BooferGH - класс, хранящий данные ГХ в оперативной памяти программы (буфер)</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2include_2boofergh_8h_source.html#l00008">boofergh.h:9</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_a36171e3ffe91d34433a7ecf183ae9b6b"><div class="ttname"><a href="class_g_h_model.html#a36171e3ffe91d34433a7ecf183ae9b6b">GHModel::setData</a></div><div class="ttdeci">bool setData(const QModelIndex &amp;index, const QVariant &amp;value, int role=Qt::EditRole)</div><div class="ttdoc">setData метод для редактирования элемента пользователем</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00071">ghmodel.cpp:71</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_a96738a4b13c7d732e82d61295c9b4fb3"><div class="ttname"><a href="class_g_h_model.html#a96738a4b13c7d732e82d61295c9b4fb3">GHModel::data</a></div><div class="ttdeci">QVariant data(const QModelIndex &amp;index, int role=Qt::DisplayRole) const</div><div class="ttdoc">data возвращает содержимое элемента или его форматирование</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00048">ghmodel.cpp:48</a></div></div>
<div class="ttc" id="aclass_q_abstract_table_model_html"><div class="ttname"><a href="class_q_abstract_table_model.html">QAbstractTableModel</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_a202dda5e22612fb141cbcd30c69417e7"><div class="ttname"><a href="class_g_h_model.html#a202dda5e22612fb141cbcd30c69417e7">GHModel::GHModel</a></div><div class="ttdeci">GHModel(BooferGH *data, QObject *parent=0)</div><div class="ttdoc">GHModel Конструктор класса</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00005">ghmodel.cpp:5</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_a216164b6463b89b27a49a117aa626793"><div class="ttname"><a href="class_g_h_model.html#a216164b6463b89b27a49a117aa626793">GHModel::columnCount</a></div><div class="ttdeci">int columnCount(const QModelIndex &amp;parent=QModelIndex()) const</div><div class="ttdoc">columnCount возвращает количество cтолбцов в модели</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00017">ghmodel.cpp:17</a></div></div>
<div class="ttc" id="aclass_boofer_g_h_html_aaa352e93d4f0933b7c5212705af01b20"><div class="ttname"><a href="class_boofer_g_h.html#aaa352e93d4f0933b7c5212705af01b20">BooferGH::data_x</a></div><div class="ttdeci">std::vector&lt; double &gt; data_x</div><div class="ttdoc">первый вектор градуировочных характеристик</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2include_2boofergh_8h_source.html#l00012">boofergh.h:12</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_aa605317e7690ef97f23c3a7b58d033d5"><div class="ttname"><a href="class_g_h_model.html#aa605317e7690ef97f23c3a7b58d033d5">GHModel::removeRows</a></div><div class="ttdeci">bool removeRows(int row, int count, const QModelIndex &amp;parent=QModelIndex())</div><div class="ttdoc">removeRows метод для удаления строк</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00114">ghmodel.cpp:114</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_acddb2860fa3803c142e4dd64499061cb"><div class="ttname"><a href="class_g_h_model.html#acddb2860fa3803c142e4dd64499061cb">GHModel::headerData</a></div><div class="ttdeci">QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const</div><div class="ttdoc">headerData возвращает заголовок столбца или его форматирование</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00023">ghmodel.cpp:23</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_a77d68b247079423f2977d8c83be20c7b"><div class="ttname"><a href="class_g_h_model.html#a77d68b247079423f2977d8c83be20c7b">GHModel::insertRows</a></div><div class="ttdeci">bool insertRows(int row, int count, const QModelIndex &amp;parent=QModelIndex())</div><div class="ttdoc">insertRows метод для добавления строк</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00086">ghmodel.cpp:86</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_ab03cd08daeffd4ca903a5b653058aae1"><div class="ttname"><a href="class_g_h_model.html#ab03cd08daeffd4ca903a5b653058aae1">GHModel::boofer</a></div><div class="ttdeci">BooferGH * boofer</div><div class="ttdoc">класс для хранения данных модели</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2include_2ghmodel_8h_source.html#l00099">ghmodel.h:99</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_a80b7f89d0d7dd6bfe078c7aa13102757"><div class="ttname"><a href="class_g_h_model.html#a80b7f89d0d7dd6bfe078c7aa13102757">GHModel::rowCount</a></div><div class="ttdeci">int rowCount(const QModelIndex &amp;parent=QModelIndex()) const</div><div class="ttdoc">rowCount возвращает количество строк в модели</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00010">ghmodel.cpp:10</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_a409b014c8e1eef5d2ff8eae8a716c7b5"><div class="ttname"><a href="class_g_h_model.html#a409b014c8e1eef5d2ff8eae8a716c7b5">GHModel::push_back_pair</a></div><div class="ttdeci">bool push_back_pair(double x, double y, const QModelIndex &amp;parent=QModelIndex())</div><div class="ttdoc">push_back_pair добавляет строку из двух заданных элементов в конец модели</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00103">ghmodel.cpp:103</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_a4c7d107fd510dbbd8806e661a6d262a2"><div class="ttname"><a href="class_g_h_model.html#a4c7d107fd510dbbd8806e661a6d262a2">GHModel::flags</a></div><div class="ttdeci">Qt::ItemFlags flags(const QModelIndex &amp;index) const</div><div class="ttdoc">flags возвращает параметры элемента (можно ли его редактировать, включать в выделение,...</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp_source.html#l00042">ghmodel.cpp:42</a></div></div>
<div class="ttc" id="aclass_boofer_g_h_html_abfaa06f538faffae990172acd7c64b77"><div class="ttname"><a href="class_boofer_g_h.html#abfaa06f538faffae990172acd7c64b77">BooferGH::data_y</a></div><div class="ttdeci">std::vector&lt; double &gt; data_y</div><div class="ttdoc">второй вектор градуировочных характеристик</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2include_2boofergh_8h_source.html#l00014">boofergh.h:14</a></div></div>
<div class="ttc" id="aclass_g_h_model_html_a9e47fdafa7fb4714f534b2a0b6291b01"><div class="ttname"><a href="class_g_h_model.html#a9e47fdafa7fb4714f534b2a0b6291b01">GHModel::m_header</a></div><div class="ttdeci">QStringList m_header</div><div class="ttdoc">заголовки столбцов модели</div><div class="ttdef"><b>Definition:</b> <a href="alekseev__semen_2project_2include_2ghmodel_8h_source.html#l00101">ghmodel.h:101</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_66fd516286b6b83c18536a00ebca1f7f.html">project</a></li><li class="navelem"><a class="el" href="dir_a7d76beb8f7d8071fa676c48f6b866f4.html">src</a></li><li class="navelem"><a class="el" href="dir_ddd204885720ec6be3b4d16c047e7275.html">DecodeGH</a></li><li class="navelem"><a class="el" href="alekseev__semen_2project_2src_2_decode_g_h_2ghmodel_8cpp.html">ghmodel.cpp</a></li>
    <li class="footer">Документация по Практика. Последние изменения: Ср 12 Июл 2023 16:10:11. Создано системой <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
  </ul>
</div>
</body>
</html>
